#include "student.h"
#include <string>  
#include <vector>  
#include <fstream>  
#include <sstream> 

void Student :: set_Student (string id,string name)
{
    _id=id;
    _name=name;
}


void Student :: saveToFile(const string& filename,int sta)
{
     ofstream file(filename, std::ios::app);  
        if (file.is_open()) {  
            file << "--"<<sta<< endl;
            // 写入学号  
            file << "学号: " << _id << endl;  
            // 写入姓名
            file << "姓名: "<<_name <<endl;  
            file << "       分配的设备： "<<endl;
        }


}